package com.zhanqiao.Dao;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.zhanqiao.Utils.GetDataSourceUtil;
import com.zhanqiao.domain.ArticleBean;
import com.zhanqiao.domain.ProductBean;
import org.apache.commons.dbutils.QueryRunner;

import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

public class ProductOffSaleDao implements ArticleDao {
    @Override
    public int insertArticle(ProductBean productBean, String tag) {
        return 0;
    }

    @Override
    public int deleteProduct(int id) throws SQLException {
        DataSource dataSource = GetDataSourceUtil.getDataSource();
        QueryRunner queryRunner = new QueryRunner(dataSource);
        return queryRunner.update("update product set pstatus=1 where pid=" + id);

    }

    @Override
    public List<ArticleBean> selectAll() {
        return null;
    }

    @Override
    public int updateProduct(Integer pid, String pname, Integer psaleprice, Integer pcount) throws SQLException {
        return 0;
    }


}
